from django.db import models
from django.db.models import permalink
from django.conf import settings
from django.core.files.storage import FileSystemStorage

import capabilities.models

fs = FileSystemStorage(location=settings.STATIC_ROOT, base_url=settings.STATIC_URL)

class XFN(models.Model):
    """
    XFN data
    """
    name = models.CharField(max_length=100)
    slug = models.SlugField(unique=True)
    url = models.URLField()
    icon = models.ImageField(storage=fs, upload_to='uploads/xfn/XFN/icon')
    blurb = models.CharField(max_length=100, blank=True)
    order = capabilities.models.OrderField()
    
    class Meta:
        ordering = ['order']
    
    def __unicode__(self):
        return self.name 